\(\int \frac {\tan (c+d x)}{a+b \sec (c+d x)} \, dx\) [290]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 35 \[ \int \frac {\tan (c+d x)}{a+b \sec (c+d x)} \, dx=-\frac {\log (\cos (c+d x))}{a d}-\frac {\log (a+b \sec (c+d x))}{a d} \]

[Out]

-ln(cos(d*x+c))/a/d-ln(a+b*sec(d*x+c))/a/d

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.211, Rules used = {3970, 36, 29, 31} \[ \int \frac {\tan (c+d x)}{a+b \sec (c+d x)} \, dx=-\frac {\log (a+b \sec (c+d x))}{a d}-\frac {\log (\cos (c+d x))}{a d} \]

[In]

Int[Tan[c + d*x]/(a + b*Sec[c + d*x]),x]

[Out]

-(Log[Cos[c + d*x]]/(a*d)) - Log[a + b*Sec[c + d*x]]/(a*d)

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 3970

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[-(-1)^((m - 1
)/2)/(d*b^(m - 1)), Subst[Int[(b^2 - x^2)^((m - 1)/2)*((a + x)^n/x), x], x, b*Csc[c + d*x]], x] /; FreeQ[{a, b
, c, d, n}, x] && IntegerQ[(m - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {1}{x (a+x)} \, dx,x,b \sec (c+d x)\right )}{d} \\ & = \frac {\text {Subst}\left (\int \frac {1}{x} \, dx,x,b \sec (c+d x)\right )}{a d}-\frac {\text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \sec (c+d x)\right )}{a d} \\ & = -\frac {\log (\cos (c+d x))}{a d}-\frac {\log (a+b \sec (c+d x))}{a d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.54 \[ \int \frac {\tan (c+d x)}{a+b \sec (c+d x)} \, dx=-\frac {\log (b+a \cos (c+d x))}{a d} \]

[In]

Integrate[Tan[c + d*x]/(a + b*Sec[c + d*x]),x]

[Out]

-(Log[b + a*Cos[c + d*x]]/(a*d))

Maple [A] (verified)

Time = 0.28 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.94

method result size
derivativedivides \(\frac {-\frac {\ln \left (a +b \sec \left (d x +c \right )\right )}{a}+\frac {\ln \left (\sec \left (d x +c \right )\right )}{a}}{d}\) \(33\)
default \(\frac {-\frac {\ln \left (a +b \sec \left (d x +c \right )\right )}{a}+\frac {\ln \left (\sec \left (d x +c \right )\right )}{a}}{d}\) \(33\)
risch \(\frac {i x}{a}+\frac {2 i c}{a d}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 b \,{\mathrm e}^{i \left (d x +c \right )}}{a}+1\right )}{a d}\) \(54\)

[In]

int(tan(d*x+c)/(a+b*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(-1/a*ln(a+b*sec(d*x+c))+1/a*ln(sec(d*x+c)))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.54 \[ \int \frac {\tan (c+d x)}{a+b \sec (c+d x)} \, dx=-\frac {\log \left (a \cos \left (d x + c\right ) + b\right )}{a d} \]

[In]

integrate(tan(d*x+c)/(a+b*sec(d*x+c)),x, algorithm="fricas")

[Out]

-log(a*cos(d*x + c) + b)/(a*d)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 82 vs. \(2 (27) = 54\).

Time = 2.92 (sec) , antiderivative size = 82, normalized size of antiderivative = 2.34 \[ \int \frac {\tan (c+d x)}{a+b \sec (c+d x)} \, dx=\begin {cases} \frac {\tilde {\infty } x \tan {\left (c \right )}}{\sec {\left (c \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\- \frac {1}{b d \sec {\left (c + d x \right )}} & \text {for}\: a = 0 \\\frac {\log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a d} & \text {for}\: b = 0 \\\frac {x \tan {\left (c \right )}}{a + b \sec {\left (c \right )}} & \text {for}\: d = 0 \\- \frac {\log {\left (\frac {a}{b} + \sec {\left (c + d x \right )} \right )}}{a d} + \frac {\log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a d} & \text {otherwise} \end {cases} \]

[In]

integrate(tan(d*x+c)/(a+b*sec(d*x+c)),x)

[Out]

Piecewise((zoo*x*tan(c)/sec(c), Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), (-1/(b*d*sec(c + d*x)), Eq(a, 0)), (log(tan(c
 + d*x)**2 + 1)/(2*a*d), Eq(b, 0)), (x*tan(c)/(a + b*sec(c)), Eq(d, 0)), (-log(a/b + sec(c + d*x))/(a*d) + log
(tan(c + d*x)**2 + 1)/(2*a*d), True))

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.54 \[ \int \frac {\tan (c+d x)}{a+b \sec (c+d x)} \, dx=-\frac {\log \left (a \cos \left (d x + c\right ) + b\right )}{a d} \]

[In]

integrate(tan(d*x+c)/(a+b*sec(d*x+c)),x, algorithm="maxima")

[Out]

-log(a*cos(d*x + c) + b)/(a*d)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 114 vs. \(2 (35) = 70\).

Time = 0.35 (sec) , antiderivative size = 114, normalized size of antiderivative = 3.26 \[ \int \frac {\tan (c+d x)}{a+b \sec (c+d x)} \, dx=\frac {\log \left (\frac {{\left | 2 \, b + \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {2 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - 2 \, {\left | a \right |} \right |}}{{\left | 2 \, b + \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {2 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + 2 \, {\left | a \right |} \right |}}\right )}{d {\left | a \right |}} \]

[In]

integrate(tan(d*x+c)/(a+b*sec(d*x+c)),x, algorithm="giac")

[Out]

log(abs(2*b + 2*a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 2*b*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 2*abs(a)
)/abs(2*b + 2*a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 2*b*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 2*abs(a)))
/(d*abs(a))

Mupad [B] (verification not implemented)

Time = 14.70 (sec) , antiderivative size = 71, normalized size of antiderivative = 2.03 \[ \int \frac {\tan (c+d x)}{a+b \sec (c+d x)} \, dx=\frac {\mathrm {atan}\left (\frac {a\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{a\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,1{}\mathrm {i}+b\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,1{}\mathrm {i}+b\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,1{}\mathrm {i}}\right )\,2{}\mathrm {i}}{a\,d} \]

[In]

int(tan(c + d*x)/(a + b/cos(c + d*x)),x)

[Out]

(atan((a*sin(c/2 + (d*x)/2)^2)/(a*cos(c/2 + (d*x)/2)^2*1i + b*cos(c/2 + (d*x)/2)^2*1i + b*sin(c/2 + (d*x)/2)^2
*1i))*2i)/(a*d)